package other.edan.order;

import com.rkhd.platform.sdk.data.model.SoftwareMappingTable__c;
import other.edan.order.utils.HCXObjectService;

import java.util.List;

public class Test {
    //拆分软件映射表数据
    private static void splitYinshe(){
        String sql="select id from softwareMappingTable__c ";
        List<SoftwareMappingTable__c> softwareMappingTableList=HCXObjectService.queryAll(sql);
        System.err.println(softwareMappingTableList.size());

        for(SoftwareMappingTable__c softwareMappingTable:softwareMappingTableList){
            SoftwareMappingTable__c table=new SoftwareMappingTable__c();
            table.setId(softwareMappingTable.getId());
            table=HCXObjectService.get(table);

            String productRegistrationModel__c = table.getProductRegistrationModel__c();
            String[] split = productRegistrationModel__c.split("/");
            for (String s:split){
                String newS=s.trim();
                System.err.println(newS);

                SoftwareMappingTable__c newTable=table;
                newTable.setProductRegistrationModel__c(newS);
                HCXObjectService.insert(newTable).getErrorMessage();
            }
        }
    }

    public static void main(String[] args){
        splitYinshe();
    }
}
